var express = require('express');
const db = require("../db")
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
        res.send({
            msg:"这是接口地址"
        })

});

router.get("/news",(req,res)=>{
    let sql = "select * from jh";
    db(sql,(err,results)=>{
        if(err){throw err};
        res.json({
            code:111,
            msg:"获取成功",
            data:results
        })
    })
})


module.exports = router;
